//引入封装好的请求方式
import {
    get,
    post
} from './http.js'


export const menuAdd = data => post('/menuadd', data)
export const getMenuList = () => get('/menulist?istree=true')
//菜单的删除
export const menuDel = (data) => post("/menudelete", data);
//菜单的修改
export const menuEdit = (data) => post("/menuedit", data);
//获取菜单的一条数据
export const getMenuInfo = (data) => get("/menuinfo", data);

//角色列表
export const getRoleList = () => get("/rolelist");
//角色的添加
export const roleAdd = (data) => post("/roleadd", data);
//角色的删除
export const roleDel = (data) => post("/roledelete", data);
//角色的修改
export const roleEdit = (data) => post("/roleedit", data);
//获取角色的一条数据
export const getRoleInfo = (data) => get("/roleinfo", data);

//管理员列表
export const userlist = params => get('/userlist', params)
//管理员的添加
export const useradd = data => post('/useradd', data)
//管理员的删除
export const userdelete = data => post('/userdelete', data)
//管理员的编辑
export const useredit = data => post('/useredit', data)
//管理员获取（一条）
export const userinfo = params => get('/userinfo', params)
//管理员总数查询
export const usercount = () => get('/usercount')
//管理员的登录
export const userlogin = data => post('/userlogin', data)

// 分类添加
export const cateAdd = data => post('/cateadd', data, true)
// 分类列表口
export const cateList = data => get('/catelist', data)
// 分类删除
export const cateDel = data => post('/catedelete', data)
// 分类列表一条数据
export const cateInfo = data => get('/cateinfo', data)
// 分类编辑
export const cateEdit = data => post('/cateedit', data, true)

//商品规格属性列表
export const specslist = params => get('/specslist', params)
//商品规格属性的添加
export const specsadd = data => post('/specsadd', data)
//商品规格属性的删除
export const specsdelete = data => post('/specsdelete', data)
//商品规格属性的编辑
export const specsedit = data => post('/specsedit', data)
//商品规格属性获取（一条）
export const specsinfo = params => get('/specsinfo', params)
//商品规格属性总数查询
export const specscount = () => get('/specscount')

//商品列表
export const goodslist = params => get('/goodslist', params)
//商品的添加
export const goodsadd = data => post('/goodsadd', data, true)
//商品的删除
export const goodsdelete = data => post('/goodsdelete', data)
//商品的编辑
export const goodsedit = data => post('/goodsedit', data, true)
//商品获取（一条）
export const goodsinfo = params => get('/goodsinfo', params)
//商品总数查询
export const goodscount = () => get('/goodscount')

//会员列表
export const memberlist = () => get('/memberlist')
// 会员获取
export const memberinfo = (data) => get('/memberinfo',data)
// 会员修改
export const memberedit = (data) => post("/memberedit", data);

// 轮播图添加
export const banneradd = (data) => post("/banneradd", data,true);
// 轮播图列表
export const bannerlist = () => get("/bannerlist");
// 轮播图获取
export const bannerinfo = (data) => get('/bannerinfo',data)
// 轮播图修改
export const banneredit = (data) => post("/banneredit", data);
// 轮播图的删除
export const bannerdelete = (data) => post("/bannerdelete", data);

// 限时秒杀添加
export const seckadd = (data) => post("/seckadd", data);
// 限时秒杀列表
export const secklist = () => get("/secklist");
// 限时秒杀获取
export const seckinfo = (data) => get('/seckinfo',data)
// 限时秒杀修改
export const seckedit = (data) => post("/seckedit", data);
// 限时秒杀的删除
export const seckdelete = (data) => post("/seckdelete", data);
